﻿<UserControl x:Class="LiveTiss.Guias.UserControls.DiagnosticoGuia"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:guia="clr-namespace:LiveTiss.Guias"
    xmlns:uc="clr-namespace:LiveTiss.Guias.UserControls"
    xmlns:converter="clr-namespace:LiveTiss.Classes.TypeConverter"
    x:Name="uc">

    <UserControl.Resources>
        <converter:EnumConverter x:Key="enumConverter"  />
        <converter:BoolToVisibilityConverter x:Key="visibilityConverter" />
    </UserControl.Resources>

    <StackPanel Width="890">
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <CheckBox Name="chkTipoDoenca" Content="Tipo de Doença" FontFamily="Segoe UI" FontSize="13.333"
                          IsChecked="{Binding Path=Value.tipoDoencaSpecified, ElementName=uc, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                <ComboBox Name="cbxTipoDoenca" Width="280" Margin="0,6,0,0" SelectedValue="Key" DisplayMemberPath="Value" HorizontalAlignment="Left" 
                          ItemsSource="{Binding Path=Value.TipoDoencaItems, ElementName=uc, Mode=OneWay}"
                          SelectedIndex="{Binding Path=Value.tipoDoenca,ElementName=uc,Converter={StaticResource enumConverter}, ConverterParameter='TipoDoenca', ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
                          IsEnabled="{Binding Path=IsChecked, ElementName=chkTipoDoenca}"/>
            </StackPanel>
        </Grid>
        <Grid Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Column="2">
                <CheckBox Name="cbxTempoDoenca" Content="Tempo Evoluca Doença" FontFamily="Segoe UI" FontSize="13.333" IsChecked="False" />
            </StackPanel>
        </Grid>
        <uc:TempoEvolucaoDoenca x:Name="tempoEvolucaoDoenca" 
                            Value="{Binding Path=Value.tempoReferidoEvolucaoDoenca, ElementName=uc, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
                            Visibility="{Binding Path=IsChecked,ElementName=cbxTempoDoenca,Converter={StaticResource visibilityConverter}}"/>
        <Grid Height="53" Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                <CheckBox Name="chkIndicacaoAcidente" Content="Indicação de Acidente" FontFamily="Segoe UI" FontSize="13.333"
                          IsChecked="{Binding Path=Value.indicadorAcidenteSpecified, ElementName=uc, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                <ComboBox Name="cbxIndicacaoAcidente" Width="280" Margin="0,6,0,0" SelectedValue="Key" DisplayMemberPath="Value" HorizontalAlignment="Left" 
                          ItemsSource="{Binding Path=Value.IndicadorAcidenteItems, ElementName=uc, Mode=OneWay}"
                          SelectedIndex="{Binding Path=Value.indicadorAcidente,ElementName=uc, Converter={StaticResource enumConverter}, ConverterParameter='IndicadorAcidente', ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
                          IsEnabled="{Binding Path=IsChecked, ElementName=chkIndicacaoAcidente}"/>
            </StackPanel>
        </Grid>
        <Grid Margin="0,0,6,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.024*"/>
                <ColumnDefinition Width="0.976*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Column="2">
                <!--Unchecked="cbxCID_Checked"-->
                <CheckBox Name="cbxCID" Content="CID" FontFamily="Segoe UI" FontSize="13.333" IsChecked="False"/>
            </StackPanel>
        </Grid>
        <uc:CID x:Name="cidPrincipal" Value="{Binding Path=Value.CID, ElementName=uc, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
                            Visibility="{Binding Path=IsChecked,ElementName=cbxCID,Converter={StaticResource visibilityConverter}}" />


    </StackPanel>
</UserControl>
